﻿using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace EventBus
{
    public class StudentService : ApplicationService,IStudentService
    {
        public IRepository<Student, Guid> studentRepository { get; set; }
        public async Task<bool> InsertAsync(string name, int age)
        {
                var model = new Student() { Name = name, Age = age };
                await studentRepository.InsertAsync(model);
                model.ChangeScoreCount(new Random().Next()); //调用积分变更方法，执行事件发布
            return true;
        }

       
    }
}
